<?php if($products): ?>
<?php slot('sales_top') ?>
<div class="topsale">
	<div class="topsaletop">
		<div class="topsaletopleft">
			<p class="lmenu"><?php echo __('MÜÜGI TOP') ?></p>
		</div>
		<div class="topsaletopright">
			<img src="/enermaatik/img/saleright.png" width="9" height="34" alt=""/>
		</div>
		<div class="clear"></div>
	</div>
	<div class="topsalemain">
		<div class="topsalemaincontent">
			<?php foreach($products as $product): ?>
				<?php $link = isset($productLinks[$product['id']]) ? $productLinks[$product['id']] : '#' ?>
			<div class="toptoode">
				<div class="toptoodetop">
					<div class="toptoodetopleft">
						<a href="<?php echo $link ?>"><img src="<?php echo @myPicture::getInstance($product['ProductPictures'][0]['file'])->thumbnail(45, 60)->url() ?>" width="45" height="60" alt=""/></a>
					</div>
					<div class="toptoodetopright">
						<a href="<?php echo $link ?>"><img src="/enermaatik/img/korvsmall.png" width="31" height="33" alt=""/></a>
					</div>
					<div class="clear"></div>
				</div>
				<div class="toptoodebottom">
					<p><a href="<?php echo $link ?>"><?php echo $product['Translation'][$sf_user->getCulture()]['name'] ?></a></p>
					<h1><a href="<?php echo $link ?>">
                                        <?php if(!empty($product['discount_price'])):?>
                                          <?php echo price_format($product['discount_price']) ?>
                                        <?php else:?>
                                          <?php echo price_format($product['price']) ?>
                                        <?php endif;?>
                                        </a></h1>
				</div>
			</div>
			<?php endforeach; ?>
		</div>
	</div>
</div>
<?php end_slot() ?>
<?php endif; ?>